home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / var / db / pkg / net-wireless / madwifi-ng-0.1531.20060427 / madwifi-ng-0.1531.20060427.ebuild < prev    next >
Text File  |  2006-05-11  |  4KB  |  127 lines

  1. # Copyright 1999-2006 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: /var/cvsroot/gentoo-x86/net-wireless/madwifi-ng/madwifi-ng-0.1531.20060427.ebuild,v 1.1 2006/04/27 16:34:52 brix Exp $
  4.  
  5. inherit linux-mod
  6.  
  7. MY_P=${PN}-r${PV:2:4}-${PV:7:8}
  8. S=${WORKDIR}/${MY_P}
  9.  
  10. DESCRIPTION="Next Generation driver for Atheros based IEEE 802.11a/b/g wireless LAN cards with injection patch"
  11. HOMEPAGE="http://www.madwifi.org/"
  12. SRC_URI="http://snapshots.madwifi.org/madwifi-ng/${MY_P}.tar.gz"
  13.  
  14. LICENSE="|| ( BSD GPL-2 )"
  15. SLOT="0"
  16. KEYWORDS="~amd64 ~ppc ~x86"
  17.  
  18. IUSE="amrr onoe"
  19. DEPEND="app-arch/sharutils"
  20. RDEPEND="!net-wireless/madwifi-old
  21.         >=net-wireless/madwifi-ng-tools-${PV}"
  22.  
  23. CONFIG_CHECK="CRYPTO NET_RADIO SYSCTL"
  24. ERROR_CRYPTO="${P} requires Cryptographic API support (CONFIG_CRYPTO)."
  25. ERROR_NET_RADIO="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_NET_RADIO)."
  26. ERROR_SYSCTL="${P} requires Sysctl support (CONFIG_SYSCTL)."
  27. BUILD_TARGETS="all"
  28. MODULESD_ATH_PCI_DOCS="README"
  29.  
  30. pkg_setup() {
  31.     linux-mod_pkg_setup
  32.  
  33.     MODULE_NAMES="ath_hal(net:${S}/ath_hal)
  34.                 wlan(net:${S}/net80211)
  35.                 wlan_acl(net:${S}/net80211)
  36.                 wlan_ccmp(net:${S}/net80211)
  37.                 wlan_tkip(net:${S}/net80211)
  38.                 wlan_wep(net:${S}/net80211)
  39.                 wlan_xauth(net:${S}/net80211)
  40.                 wlan_scan_sta(net:${S}/net80211)
  41.                 wlan_scan_ap(net:${S}/net80211)"
  42.  
  43.     BUILD_PARAMS="KERNELPATH=${KV_OUT_DIR}"
  44.  
  45.     if use amrr && use onoe; then
  46.         eerror
  47.         eerror "USE=\"amrr onoe\" is invalid, you can only specify one at a time."
  48.         eerror
  49.         die "USE=\"amrr onoe\" is invalid"
  50.     fi
  51.  
  52.     if use amrr; then
  53.         MODULE_NAMES="${MODULE_NAMES} ath_rate_amrr(net:${S}/ath_rate/amrr)"
  54.         BUILD_PARAMS="${BUILD_PARAMS} ATH_RATE=ath_rate/amrr"
  55.     elif use onoe; then
  56.         MODULE_NAMES="${MODULE_NAMES} ath_rate_onoe(net:${S}/ath_rate/onoe)"
  57.         BUILD_PARAMS="${BUILD_PARAMS} ATH_RATE=ath_rate/onoe"
  58.     else
  59.         MODULE_NAMES="${MODULE_NAMES} ath_rate_sample(net:${S}/ath_rate/sample)"
  60.         BUILD_PARAMS="${BUILD_PARAMS} ATH_RATE=ath_rate/sample"
  61.     fi
  62.  
  63.     MODULE_NAMES="${MODULE_NAMES} ath_pci(net:${S}/ath)"
  64. }
  65.  
  66. src_unpack() {
  67.     unpack ${A}
  68.  
  69.     cd ${S}
  70.     epatch ${FILESDIR}/madwifi-ng-r1526.patch
  71.     for dir in ath ath_hal net80211 ath_rate/amrr ath_rate/onoe ath_rate/sample; do
  72.         convert_to_m ${S}/${dir}/Makefile
  73.     done
  74. }
  75.  
  76. src_compile() {
  77.     # assists in debugging
  78.     emake KERNELPATH=${KV_OUT_DIR} info || die "emake info failed"
  79.  
  80.     # needed by the modules
  81.     emake svnversion.h
  82.  
  83.     linux-mod_src_compile
  84. }
  85.  
  86. src_install() {
  87.     linux-mod_src_install
  88.  
  89.     dodoc README THANKS docs/users-guide.pdf docs/WEP-HOWTO.txt
  90.  
  91.     # install headers for use by
  92.     # net-wireless/wpa_supplicant and net-wireless/hostapd
  93.     insinto /usr/include/madwifi/include/
  94.     doins include/*.h
  95.     insinto /usr/include/madwifi/net80211
  96.     doins net80211/*.h
  97. }
  98.  
  99. pkg_postinst() {
  100.     local moddir="${ROOT}/lib/modules/${KV_FULL}/net/"
  101.  
  102.     einfo "Removing old ath_rate modules"
  103.     if use amrr; then
  104.         [[ -f "${moddir}/ath_rate_onoe.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_onoe.${KV_OBJ}"
  105.         [[ -f "${moddir}/ath_rate_sample.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_sample.${KV_OBJ}"
  106.     elif use onoe; then
  107.         [[ -f "${moddir}/ath_rate_amrr.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_amrr.${KV_OBJ}"
  108.         [[ -f "${moddir}/ath_rate_sample.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_sample.${KV_OBJ}"
  109.     else
  110.         [[ -f "${moddir}/ath_rate_amrr.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_amrr.${KV_OBJ}"
  111.         [[ -f "${moddir}/ath_rate_onoe.${KV_OBJ}" ]] && rm "${moddir}/ath_rate_onoe.${KV_OBJ}"
  112.     fi
  113.  
  114.     linux-mod_pkg_postinst
  115.  
  116.     einfo
  117.     einfo "Interfaces (athX) are now automatically created upon loading the ath_pci"
  118.     einfo "module."
  119.     einfo
  120.     einfo "The type of the created interface can be controlled through the 'autocreate'"
  121.     einfo "module parameter."
  122.     einfo
  123.     einfo "If you use net-wireless/wpa_supplicant or net-wireless/hostapd with madwifi"
  124.     einfo "you should remerge them now."
  125.     einfo
  126. }
  127.